<?php
/**
 * Cost Admin
 * Пакетник работы с ценами
 * Контроллер
 */

// No direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.application.component.view' );
jimport('joomla.html.pagination');
/**
CREATE TABLE IF NOT EXISTS `jos_shop_cost` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `price_min` int(11) NOT NULL,
  `price_max` int(11) NOT NULL,
  `koef` float NOT NULL DEFAULT '0',
  `for_new` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
 */
class ShopViewCost extends JView
{
    function display($tpl = null)
    {
        JToolBarHelper::title(JText::_( 'Управление ценами' ), 'generic.png');
        JToolBarHelper::save('saveUpdateCost');
        JToolBarHelper::cancel('cancelUpdateCost');
        $mainframe = &JFactory::getApplication();
        $db = & JFactory::getDBO();
        $test = array();
        $sql = "SELECT * FROM #__shop_cost";
        $db->setQuery($sql);
        $items = $db->loadObjectList();
        //printu($items,'items');
        $this->assignRef('items',$items);
        parent::display($tpl);
    }
}
?>